home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / cups-bsd.postinst < prev    next >
Text File  |  2008-10-20  |  2KB  |  81 lines

  1. #! /bin/sh
  2. # postinst script for cups
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postinst> `configure' <most-recently-configured-version>
  10. #        * <old-postinst> `abort-upgrade' <new version>
  11. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  12. #          <new-version>
  13. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  14. #          <failed-install-package> <version> `removing'
  15. #          <conflicting-package> <version>
  16. # for details, see /usr/doc/packaging-manual/
  17. #
  18. # quoting from the policy:
  19. #     Any necessary prompting should almost always be confined to the
  20. #     post-installation script, and should be protected with a conditional
  21. #     so that unnecessary prompting doesn't happen if a package's
  22. #     installation fails and the `postinst' is called with `abort-upgrade',
  23. #     `abort-remove' or `abort-deconfigure'.
  24.  
  25. # Debconf
  26. . /usr/share/debconf/confmodule
  27.  
  28. case "$1" in
  29.     configure)
  30.  
  31.     # Set documentation symlinks
  32.     if [ -d /usr/share/doc/cups ]; then
  33.         if [ ! -e /usr/share/doc/cups-bsd ]; then
  34.         ln -sf cups-common /usr/share/doc/cups-bsd
  35.         fi
  36.     fi
  37.  
  38.     # Add cups-lpd to inetd.conf
  39.     db_get cups-bsd/setuplpd
  40.     if [ "$RET" = "true" ]; then
  41.         update-inetd --add 'printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd'
  42.     fi
  43.  
  44.     # Manage printcap file and associated symlinks
  45.     if [ -e /etc/cups/cupsd.conf ]; then
  46.         if [ -e /etc/printcap.cups ]; then
  47.         rm -f /etc/printcap.cups
  48.         fi
  49.         if [ -L /etc/printcap -a ! -e /etc/printcap ]; then
  50.         rm -f /etc/printcap
  51.         fi
  52.  
  53.         printcap_file=`egrep '^Printcap ' /etc/cups/cupsd.conf | awk '{print $2}'`
  54.         if [ "$printcap_file" != "" ]; then
  55.         touch $printcap_file 2>/dev/null || true
  56.         if [ ! -e /etc/printcap -a -e $printcap_file ]; then
  57.             ln -s $printcap_file /etc/printcap
  58.         fi
  59.         fi
  60.     fi
  61.     ;;
  62.  
  63.     abort-upgrade|abort-remove|abort-deconfigure)
  64.  
  65.     ;;
  66.  
  67.     *)
  68.         echo "postinst called with unknown argument \`$1'" >&2
  69.         exit 0
  70.     ;;
  71. esac
  72.  
  73. # dh_installdeb will replace this with shell code automatically
  74. # generated by other debhelper scripts.
  75.  
  76.  
  77.  
  78. exit 0
  79.  
  80.  
  81.